/**
 * 
 */
package fr.utbm.gi.vi51.slizers.framework.schedule;

import org.janusproject.kernel.time.ConstantKernelTimeManager;

/**
 * Implementation of a time manager for the simulation.
 *
 * @author Tarik Belabbas
 *
 */
public class SimulationTimeManager extends ConstantKernelTimeManager
{
	/**
	 * Parameterized constructor.
	 * 
	 * @param stepDuration the duration of one simulation step in milliseconds
	 */
	public SimulationTimeManager( float _stepDuration )
	{
		super( _stepDuration );
	}

	/**
	 * Returns the instant amount which corresponds to the given amount,
	 * given per second.
	 * 
	 * @param _amountPerSecond the given amount per second
	 * @return the instant amount corresponding
	 */
	public float perSecond( float _amountPerSecond )
	{
		// No problem with the double -> float cast
		// getTimeStepDuration() returns a double but the constructor
		// of ConstantKernelTimeManager stores a float
		
		return _amountPerSecond * ( ( float )getTimeStepDuration() / 1000.0f );
	}
}
